package org.aksw.xoperator.sparql.http;

import java.util.HashMap;
import java.util.Map;

import org.aksw.xoperator.sparql.SparqlEndpointIdentifier;

/**
 * contains the configurational information about remote SPARQL endpoints.
 * 
 * @author joerg
 * 
 */
public class RemoteSparqlEndpointConfiguration {

	private Map<SparqlEndpointIdentifier, SparqlEndpointConfigurationItem> endpoints = new HashMap<SparqlEndpointIdentifier, SparqlEndpointConfigurationItem>();

	public void addEndpoint(SparqlEndpointIdentifier id, String url) {
		endpoints.put(id, new SparqlEndpointConfigurationItem(id, url));
	}
	public void addEndpoint(SparqlEndpointIdentifier id, String url,String parameter) {
		endpoints.put(id, new SparqlEndpointConfigurationItem(id, url,parameter));
	}
	
	public Map<SparqlEndpointIdentifier, SparqlEndpointConfigurationItem> getEndpoints() {
		return endpoints;
	}

	/**
	 * @author joerg
	 * 
	 */
	public static class SparqlEndpointConfigurationItem {

		private SparqlEndpointIdentifier id;
		private String endpointUrl;
		private String parameter;

		public String getParameter() {
			return parameter;
		}

		public void setParameter(String parameter) {
			this.parameter = parameter;
		}

		public SparqlEndpointConfigurationItem(SparqlEndpointIdentifier id,
				String endpointUrl) {
			super();
			this.id = id;
			this.endpointUrl = endpointUrl;
		}

		public SparqlEndpointConfigurationItem(SparqlEndpointIdentifier id,
				String endpointUrl, String parameter) {
			super();
			this.id = id;
			this.endpointUrl = endpointUrl;
			this.parameter = parameter;
		}

		public String getEndpointUrl() {
			return endpointUrl;
		}

		public void setEndpointUrl(String endpointUrl) {
			this.endpointUrl = endpointUrl;
		}

		public SparqlEndpointIdentifier getId() {
			return id;
		}

		public void setId(SparqlEndpointIdentifier id) {
			this.id = id;
		}

	}

}
